home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / BoxKite.dxr / Internal_61_tableau cards.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  2.0 KB  |  60 lines

  1. property spriteNum
  2. global tableau, stock, equal, hotcard, points
  3.  
  4. on beginSprite
  5.   sprite(spriteNum).visible = 1
  6.   tableau.addProp(makesymbol(spriteNum), new(script("tableau object"), []))
  7.   repeat with i = 1 to 8
  8.     sprite(spriteNum).member = stock.cards[1].rank & "_" & stock.cards[1].suit
  9.     stock.cards.deleteAt(1)
  10.     tableau[makesymbol(spriteNum)].addCard(new(script("card"), spriteNum))
  11.   end repeat
  12. end
  13.  
  14. on mouseDown
  15.   if sprite(spriteNum).visible = 1 then
  16.     sprite(spriteNum).moveableSprite = 1
  17.     sprite(spriteNum).loc = the mouseLoc
  18.     sprite(spriteNum).locZ = spriteNum + 1000
  19.     if tableau[makesymbol(spriteNum)].cards.count > 1 then
  20.       sprite(17).loc = tableau[makesymbol(spriteNum)].getlastcard().location
  21.       sprite(17).visible = 1
  22.       sprite(17).member = tableau[makesymbol(spriteNum)].cards[tableau[makesymbol(spriteNum)].cards.count - 1].membername
  23.     end if
  24.   end if
  25. end
  26.  
  27. on mouseUp
  28.   if equal = 1 then
  29.     puppetSound(3, "pickcard")
  30.     sprite(spriteNum).visible = 0
  31.     sprite(spriteNum).moveableSprite = 0
  32.     sprite(spriteNum).locZ = spriteNum
  33.     sprite(spriteNum).loc = tableau[makesymbol(spriteNum)].getlastcard().location
  34.     sprite(hotcard).member = sprite(spriteNum).member
  35.     tableau[makesymbol(spriteNum)].cards.deleteAt(tableau[makesymbol(spriteNum)].cards.count)
  36.     getlist(hotcard).add(new(script("card"), hotcard))
  37.     if (hotcard >= 18) and (hotcard <= 25) then
  38.       points = points + 10
  39.     end if
  40.     if tableau[makesymbol(spriteNum)].cards.count > 0 then
  41.       sprite(spriteNum).member = tableau[makesymbol(spriteNum)].getlastcard().membername
  42.       sprite(spriteNum).visible = 1
  43.     else
  44.       sprite(spriteNum).visible = 0
  45.       sprite(17).visible = 0
  46.     end if
  47.   else
  48.     puppetSound(3, "dropcard")
  49.     sprite(spriteNum).moveableSprite = 0
  50.     sprite(spriteNum).locZ = spriteNum
  51.     sprite(spriteNum).loc = tableau[makesymbol(spriteNum)].getlastcard().location
  52.   end if
  53.   if points = (96 * 10) then
  54.     win = "yes"
  55.     pootimer = timeout("po").new(150, #gotoit)
  56.   else
  57.     checklose()
  58.   end if
  59. end
  60.